import { defHttp } from "@/utils/http";
import { baseUrlApi } from "./utils";

export type DetailResult = {
  code: number;
  data: any;
  msg: string;
};

/** 生产领料申请单列表带分页 */
export const getProduceApplyPageList = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/produce/apply/pagelist"),
    data
  });
};

/** 查询生产领料申请单详情 */
export const getProduceApplyDetail = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/produce/apply/detail"),
    data
  });
};

/** 获取生产领料可申请明细  */
export const getProduceApplyAvailableItems = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/produce/apply/availableApplyItems"),
    data
  });
};

/** 新增生产领料单 */
export const produceApplyAdd = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/produce/apply/add"),
    data
  });
};
